#ifndef HTML_DELEGATE_H
#define HTML_DELEGATE_H

#include <QStyledItemDelegate>
#include <QPainter>
#include <QTextDocument>

/**
 * @brief 用于在表格中显示HTML文本的代理类
 */
class HTMLDelegate : public QStyledItemDelegate
{
    Q_OBJECT

public:
    explicit HTMLDelegate(QObject *parent = nullptr);

protected:
    void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
    QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
};

#endif // HTML_DELEGATE_H 